package com.springboot.demo.Service.ServiceImpl;

import com.springboot.demo.Dao.UserDao;
import com.springboot.demo.Service.UserService;
import com.springboot.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

@Autowired
private UserDao dao;

    @Override
    public User getById(Integer id) {
        return  dao.findById(id);
    }

    @Override
    public List<User> listUser() {

        return dao.listUser();
    }

    @Override
    public void addUser(User user) {
        dao.addUser(user);
    }

    @Override
    public int delUser(int id) {
       return dao.delUser(id);
    }

    @Override
    public int updateUser(User user) {
       return dao.updateUser(user);

    }
}
